using IcsSEMCtrl.Util;
using System;
namespace Lifter.Global.Device
{
	public class MessageType
	{
		public const int _CARRIER = 0;
		public const int _TRANSFER = 1;
		public const int _OPERATION = 2;
		public const int _ERROR = 3;
		public const int _HOST = 4;
		public const int _PLC = 5;
		public const int _DEBUG = 6;
		public const int _TDPS = 7;
		public const int _USEROPR = 8;
		public const int _CDADATA = 9;
		public const int _PLAYBACK = 10;
		private int _value;
		private static int _size;
		private static MessageType[] _array;
		public static string[] displayStrings;
		public static MessageType[] displayValues;
		public static MessageType CARRIER;
		public static MessageType TRANSFER;
		public static MessageType OPERATION;
		public static MessageType ERROR;
		public static MessageType HOST;
		public static MessageType PLC;
		public static MessageType DEBUG;
		public static MessageType TDPS;
		public static MessageType IT_ENUM_MAX;
		public static MessageType USEROPR;
		public static MessageType CDADATA;
		public static MessageType PLAYBACK;
		static MessageType()
		{
			MessageType._size = 11;
			MessageType._array = new MessageType[MessageType._size];
			MessageType.displayStrings = new string[MessageType._size];
			MessageType.displayValues = new MessageType[MessageType._size];
			MessageType.CARRIER = new MessageType(0);
			MessageType.TRANSFER = new MessageType(1);
			MessageType.OPERATION = new MessageType(2);
			MessageType.ERROR = new MessageType(3);
			MessageType.HOST = new MessageType(4);
			MessageType.PLC = new MessageType(5);
			MessageType.DEBUG = new MessageType(6);
			MessageType.TDPS = new MessageType(7);
			MessageType.USEROPR = new MessageType(8);
			MessageType.CDADATA = new MessageType(9);
			MessageType.PLAYBACK = new MessageType(10);
			MessageType.IT_ENUM_MAX = new MessageType(2147483647);
			MessageType.displayStrings[0] = "CARRIER";
			MessageType.displayStrings[1] = "TRANSFER";
			MessageType.displayStrings[2] = "OPERATION";
			MessageType.displayStrings[3] = "ERROR";
			MessageType.displayStrings[4] = "HOST";
			MessageType.displayStrings[5] = "PLC";
			MessageType.displayStrings[6] = "DEBUG";
			MessageType.displayStrings[7] = "TDPS";
			MessageType.displayStrings[8] = "USEROPR";
			MessageType.displayStrings[9] = "CDADATA";
			MessageType.displayStrings[10] = "PLAYBACK";
			MessageType.displayValues[0] = MessageType.CARRIER;
			MessageType.displayValues[1] = MessageType.TRANSFER;
			MessageType.displayValues[2] = MessageType.OPERATION;
			MessageType.displayValues[3] = MessageType.ERROR;
			MessageType.displayValues[4] = MessageType.HOST;
			MessageType.displayValues[5] = MessageType.PLC;
			MessageType.displayValues[6] = MessageType.DEBUG;
			MessageType.displayValues[7] = MessageType.TDPS;
			MessageType.displayValues[8] = MessageType.USEROPR;
			MessageType.displayValues[9] = MessageType.CDADATA;
			MessageType.displayValues[10] = MessageType.PLAYBACK;
		}
		public static string ValueToString(MessageType val)
		{
			string result;
			switch (val.Value())
			{
			case 0:
				result = MessageType.displayStrings[0];
				break;
			case 1:
				result = MessageType.displayStrings[1];
				break;
			case 2:
				result = MessageType.displayStrings[2];
				break;
			case 3:
				result = MessageType.displayStrings[3];
				break;
			case 4:
				result = MessageType.displayStrings[4];
				break;
			case 5:
				result = MessageType.displayStrings[5];
				break;
			case 6:
				result = MessageType.displayStrings[6];
				break;
			case 7:
				result = MessageType.displayStrings[7];
				break;
			case 8:
				result = MessageType.displayStrings[8];
				break;
			case 9:
				result = MessageType.displayStrings[9];
				break;
			case 10:
				result = MessageType.displayStrings[10];
				break;
			default:
				result = "";
				break;
			}
			return result;
		}
		public static MessageType StringToValue(string val)
		{
			MessageType result;
			if (Helper.IsNullOrEmpty(val))
			{
				result = MessageType.IT_ENUM_MAX;
			}
			else
			{
				for (int i = 0; i < MessageType.displayStrings.Length; i++)
				{
					if (val.Equals(MessageType.displayStrings[i]))
					{
						result = MessageType.displayValues[i];
						return result;
					}
				}
				result = null;
			}
			return result;
		}
		public int Value()
		{
			return this._value;
		}
		public static MessageType From_Int(int value)
		{
			MessageType result;
			if (value >= 0 && value < MessageType._size)
			{
				result = MessageType._array[value];
			}
			else
			{
				result = MessageType.IT_ENUM_MAX;
			}
			return result;
		}
		protected MessageType(int value)
		{
			this._value = value;
			if (value >= 0 && value < MessageType._size)
			{
				MessageType._array[this._value] = this;
			}
		}
		public bool Equals(MessageType otherEnum)
		{
			return otherEnum.Value() == this._value;
		}
		public override string ToString()
		{
			return MessageType.displayStrings[this._value];
		}
	}
}
